﻿using System.Collections.Generic;
using AutoMapper;

namespace GroceryPriceBook.Core.Mappers.Extensions
{
	public static class ProductAmountUnit
	{
		/// <summary>
		/// Map a Store database Model object to a View Model object for presentation
		/// </summary>
		/// <param name="item">database model object</param>
		/// <returns>view model presentation object</returns>
		public static ViewModel.ProductAmountUnit ToViewModel(this Model.ProductAmountUnit item)
		{
			return Mapper.Map<ViewModel.ProductAmountUnit>(item);
		}

		/// <summary>
		/// Map a list of ProductAmountUnit database model objects to a list of view model objects for presentation
		/// </summary>
		/// <param name="item">list of database model objects</param>
		/// <returns>list of presentation objects</returns>
		public static List<ViewModel.ProductAmountUnit> ToViewModel(this List<Model.ProductAmountUnit> item)
		{
			return Mapper.Map<List<Model.ProductAmountUnit>, List<ViewModel.ProductAmountUnit>>(item);
		}

		/// <summary>
		/// Map a Store View Model object to a database Model object
		/// </summary>
		/// <param name="item">presentation view model object</param>
		/// <returns>database model object</returns>
		public static Model.ProductAmountUnit ToModel(this ViewModel.ProductAmountUnit item)
		{
			return Mapper.Map<Model.ProductAmountUnit>(item);
		}
	}
}
